#ifndef MYMETHODS_H
#define MYMETHODS_H

#include "xmethod.h"

class CScan: public CXMethod
{
protected:
virtual bool MUpdate(list<w>::iterator it1)
{
        return false;
}
virtual	double d(const list<w>::iterator & iter1)
	{
		list<w>::iterator iter2 = iter1;
		iter2++;
		return (iter1->x + iter2->x)/2.0;
	}
virtual	double R(const list<w>::iterator & iter1)
	{
		list<w>::iterator iter2 = iter1;
		iter2++;
		return (iter2->x - iter1->x);
	}
public:
	CScan(){}
	~CScan(){}
};


class CLom: public CXMethod
{
protected:
virtual	double d(const list<w>::iterator & iter1)
	{
		list<w>::iterator iter2 = iter1;
		iter2++;
                return (iter1->x + iter2->x)/2.0 + (iter1->y - iter2->y)/(2.0*m_m); // при неправильной константе Липшица вылетает из интервала
	}
virtual	double R(const list<w>::iterator & iter1)
	{
		list<w>::iterator iter2 = iter1;
		iter2++;

                return m_m*(iter2->x - iter1->x)/2.0 - (iter1->y + iter2->y)/2.0;
	}
public:
	CLom(){}
	~CLom(){}
};

class CStrongin: public CXMethod
{
protected:
virtual	double d(const list<w>::iterator & iter1)
        {
                list<w>::iterator iter2 = iter1;
                iter2++;
                return (iter1->x + iter2->x)/2.0 + (iter1->y - iter2->y)/(2.0*m_m);  // при неправильной константе Липшица вылетает из интервала
        }
virtual	double R(const list<w>::iterator & iter1)
        {
                list<w>::iterator iter2 = iter1;
                iter2++;

                return m_m*(iter2->x - iter1->x) + (iter2->y - iter1->y)*(iter2->y - iter1->y)/(m_m*(iter2->x-iter1->x)) -
                        2.0 * (iter1->y + iter2->y);
        }
public:
        CStrongin(){}
        ~CStrongin(){}
};

#endif
